package com.jiazhong.jdbc.spring.controller;

import com.jiazhong.jdbc.spring.service.CheckoutService;
import com.jiazhong.jdbc.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Auther:shuXin
 */
@Controller
public class UserController {
    @Autowired
    private UserService userService;

    @Autowired
    private CheckoutService checkoutService;

    //买书的方法
    public void buyBook(Integer bookId,Integer userId){
        userService.buyBook(bookId,userId);
    }
    public void checkOut(Integer[] bookIds,Integer userId){
        checkoutService.checkout(bookIds,userId);
    }
}
